package com.pureut.storage.controller;

import com.pureut.storage.dto.InventoryBalanceDto;
import com.pureut.storage.service.WarehouseReportService;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import com.sale.storage.api.dto.InvoicingReportDto;
import com.sale.storage.api.vo.InventoryBalanceVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * TODO
 * 仓库报表
 * @Description
 * @Author Try
 * @Date 2023/9/11 11:11
 **/
@RestController
@RequestMapping("/warehouseReport")
public class WarehouseReportController {

    /**
     * 库存报表Service
     */
    @Resource
    private WarehouseReportService warehouseReportService;

    /**
     * 仓库余额表
     */
    @GetMapping("/getInventoryBalance1")
    public TableDataInfo<InventoryBalanceDto> getInventoryBalance(PageQuery pageQuery, InventoryBalanceVo inventoryBalanceVo){
        return warehouseReportService.getInventoryBalance(pageQuery,inventoryBalanceVo);
    }

    /**
     * 仓库余额表
     */
    @GetMapping("/getInventoryBalance2")
    public TableDataInfo<InventoryBalanceDto> getInventoryBalance2(PageQuery pageQuery, InventoryBalanceVo inventoryBalanceVo){
        return warehouseReportService.getInventoryBalance2(pageQuery,inventoryBalanceVo);
    }

    /**
     * 进销存报表
     */
    @GetMapping("/getInvoicingReport")
    public List<InvoicingReportDto> getInvoicingReport(InventoryBalanceVo inventoryBalanceVo){
        return warehouseReportService.getInvoicingReport(inventoryBalanceVo);
    }

}
